<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Ringer博客 - 注册</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="stylesheet" href="/static/home/css/layui.css" media="all">
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/static/home/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/static/home/css/style.min862f.css" rel="stylesheet">
    <style>
        .middle-box h1 {
            font-size: 50px;
        }
    </style>
</head>

<body class="gray-bg">
<div class="middle-box text-center loginscreen">
    <div>
        <div>
            <h1 class="logo-name">
                <img src="" alt="">
            </h1>
        </div>
        <h3>欢迎注册Ringer博客</h3>
        <p>创建一个新账户</p>
        <form method="post" action="{{ url('/register') }}">
            @csrf
            <div class="form-group">
                <input type="text" name="email" class="form-control" placeholder="请输入邮箱" required>
            </div>
            <div class="form-group">
                <input type="text" name="name" class="form-control" placeholder="请输入昵称" required>
            </div>
            <div class="form-group">
                <input type="text" name="captcha" style="width: 200px;float: left;" class="form-control" required
                       placeholder="请输入图形验证码">
                <img style="width: 96px;  cursor:pointer; margin-left: 4px; border-radius: 3px; height: 32px; border: 1px solid #1ab394; background-color: #F5F5F5;"
                     title="点击刷新" src="{{captcha_src()}}" onclick="this.src=this.src=this.src+'?t='+Math.random();">
            </div>
            <div class="form-group">
                <input type="password" name="password" class="form-control" placeholder="密码至少为六位" required>
            </div>
            <div class="form-group">
                <input type="password" name="password_confirmation" class="form-control" placeholder="请再次输入密码" required>
            </div>
            <div class="form-group text-left">
                <input type="checkbox" checked lay-skin="switch">我同意注册协议
            </div>
            <input type="submit" class="btn btn-primary block full-width m-b" value="注 册">
            <p class="text-muted text-center">
                <small>已经有账户了？</small>
                <a href="{{ url('/loginForm') }}">去登录</a>
            </p>
        </form>
    </div>
</div>
<script src="/static/home/js/layui.js" charset="utf-8"></script>
<script>
    layui.use('layer', function () {
        var layer = layui.layer;

        //错误提示
        @if(count($errors)>0)
        @foreach($errors->all() as $error)
        layer.msg('{{$error}}', {icon: 5});
        @break
        @endforeach
        @endif

        //一次性正确信息提示
        @if(session('success'))
        layer.msg("{{session('success')}}", {icon: 6});
        @endif

        //一次性错误信息提示
        @if(session('error'))
        layer.msg("{{session('error')}}", {icon: 5});
        @endif
    });
</script>
</body>
</html>
